var EndLayer = cc.LayerColor.extend({
    _shareLabel : null,
    ///////////// constructor /////////////
    ctor:function () {
        ///////////// 1. super init first /////////////
        this._super();
        this.setColor( cc.color.BLACK );
        this.opacity = 255;
        // add touch event
        this.addTouchEvent();
        /////////// get win size //////////////////
        var size = cc.director.getWinSize();

        this.addCanvas();

        /////////////// setting score label///////////////////////////
        this._shareLabel = cc.LabelTTF.create("...声明：Demo中部分美术素材来自网络...", "Arial", 25 );
        this._shareLabel.x = size.width * 0.5;
        this._shareLabel.y = size.height * 0.5;
        this._shareLabel.setColor( cc.color.BLUE );
        this._shareLabel.setScale(1.6);
        this.addChild( this._shareLabel, 10 );

        return true;
    },
    addTouchEvent : function(){
        cc.eventManager.addListener({
            event: cc.EventListener.TOUCH_ONE_BY_ONE,
            swallowTouches: true,
            onTouchBegan: this.onTouchBegan
        }, this );
    },
    ////////////////////////////////////////////////
    onTouchBegan : function (touch, event) {
        cc.director.end();
        return true;
    },
    addCanvas : function(){
        var filename = MainResource("nextC.jpg");
        var background = new cc.Sprite(filename);
        background.setPosition( cc.p(cc.winSize.width/2,cc.winSize.height/2) );
        this.addChild(background);
    }

});
